package com.wyvoid.forum.dao.hibernate;

import com.wyvoid.core.persistent.Pagination;
import com.wyvoid.core.persistent.hibernate.HibernateDAO;
import com.wyvoid.core.persistent.hibernate.HibernatePage;
import com.wyvoid.forum.dao.IActLogDAO;
import com.wyvoid.forum.domain.DoingLog;

/**
 * 日志信息Hibernate数据处理实现
 */
public class ActLogDAO extends HibernateDAO<DoingLog> implements IActLogDAO {

    /**
     * 查找全部的操作日志信息
     *
     * @param name       操作名称关键字
     * @param pagination 分页对象
     * @return List 操作日志集合
     */
    public HibernatePage<DoingLog> findActLogs(final String name, final Pagination pagination) {
        String hql = "from ActLog where name like ?";
        return super.doQuery(hql,true,pagination,"%"+name+"%");
    }

    /**
     * 删除全部的日志
     */
    public void deleteAllActLog() {
        super.executeHsql("delete from ActLog");
    }
}